home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
util
/
Mac F2C 1.3.sit
/
Mac F2C 1.3
/
Mac F2C Libraries
/
libI77 Sources
/
access.c
next >
Wrap
Text File
|
1995-01-28
|
707b
|
47 lines
/*
This function returns 0 if file called fileName exists,
1 otherwise.
IMT 28 Nov 94
*/
#include <Files.h>
static StringPtr CopyCtoPstr( StringPtr pStr, char *cStr );
int access( char *fileName, int notUsed )
{
OSErr err;
short vRefNum;
FInfo info;
Str255 pFileName;
CopyCtoPstr( pFileName, fileName ); /* Make name a Pascal string */
err = GetFInfo( pFileName, 0, &info ); /* Check on the default volume */
if ( err )
return 1;
else
return 0;
}
static StringPtr CopyCtoPstr( StringPtr pStr, char *cStr )
{
short i;
char *p;
i = 0;
p = ((char *) pStr) + 1;
while ( *cStr && i < 255 )
{
*p++ = *cStr++;
i++;
}
*pStr = i;
return (StringPtr) pStr;
}